<?php
$file_name = "data/films.txt";

$file_path = realpath($file_name);

$films = array(); //(Read file)



$file = fopen($file_path, "r"); //( Khai bao)
//Lay du lieu
while (!feof($file)) {
    $films[] = trim(fgets($file));
}

fclose($file); ////(Dong file lai)
?>

<?php foreach ($films as $a): ?>
    <?php if (!empty($a)): ?>
        <?php $film = explode(";", $a); ?>
        <?php if (isset($_GET ['uid'])): ?>
            <?php if ((int) $_GET['uid'] == (int) $film[4]): ?><br>
                <img src ="public/images/films/<?php echo $film[1] ?>">
                <?php echo $film[2] ?>
                <?php echo $film[3] ?>
                <?php echo $film[4] ?>

            <?php endif; ?>
        <?php endif; ?>     
    <?php endif; ?>    
<?php endforeach; ?>
        





